﻿<%@ Page Language="C#" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script runat="server">
        protected override void OnLoad(EventArgs e)
        {
            string constr = "data source=SHZB-WANGXF2-DP\\MSSQL;initial catalog=MyFirstDatabase;integrated security=true";
            System.Data.DataSet result = new System.Data.DataSet();
            using (var con = new System.Data.SqlClient.SqlConnection(constr))
            {
                string sql = "select * from dbo.Class122";
                using (var da = new System.Data.SqlClient.SqlDataAdapter(sql, con))
                {
                    da.Fill(result);
                }
            }
            GridView1.DataSource = result.Tables[0];
            GridView1.DataBind();
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
        <asp:GridView ID="GridView1" runat="server"></asp:GridView>
    </form>
</body>
</html>
